#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<assert.h>
typedef char x;

typedef struct BTNode {
	x data;
	struct BTNode* next;
	struct BTNode* ringth;
}BT;
typedef BT* p;
typedef struct Queue {
	struct Queue* next;
	p data;
}QJ;
typedef struct a {
	struct Queue* a;
	struct Queue* b;
}S;
void QueueInit(S* ps);
void QueueDestroyed(S* ps);
void QueuePush(S* ps, p a);
void QueuePop(S* ps);
p QueueTop(S* ps);
int QueueSize(S* ps);
bool QueueEmpty(S* ps);
void PrevOrderScanf(BT** root);
void PrevOrder(BT* root);
void InOrder(BT* root);
void PostOrder(BT* root);
void BTDestroyed(BT* root);
BT* Init();
void Level(BT* root);
int BTdepth(BT* root);
int Number(BT* root);